package com.visec.hdy.task;

import java.util.Map;

import com.visec.hdy.utils.ParameterHandle;

public class Entry {
	//java -Djava.ext.dirs=/root/ftpjar -jar task.jar -fip 192.168.1.4 -fuser admin -fpassword 123456 -ftpId sb -task server_add -exportPort 4402
	//java -Djava.ext.dirs=/root/ftpjar -jar task.jar -stip 172.26.78.2 -stport 4401 -fip 192.168.10.4 -fuser admin -fpassword 123456 -ftpId sb -task client_add -exportPort 4402
	// java -Djava.ext.dirs=/root/ftpjar  -jar task.jar -sip 192.168.10.124 -sport 4401 -task sync_server
	// -fip 192.168.0.152 -fuser admin -fpassword 123456 -ftpId sb -task
	// server_task -exportPort 4402
	public static void main(String[] args) {
		
		args = new String[] { "-stip", "192.168.10.165", "-stport", "4401", "-fip", "192.168.0.152", "-fuser", "admin","-fpassword", "123456", "-ftpId", "sb","-task","client_add","-exportPort","4402","-tools","1" };
		
		//args = new String[] { "-ftpId", "sb", "-task", "client_del", "-exportPort", "4402" };
		
		//args = new String[] { "-fip", "192.168.10.165", "-fuser", "admin", "-fpassword", "123456", "-ftpId","sb","-task","server_add","-exportPort","4402" };

		//args = new String[] { "-ftpId", "zb", "-task", "server_del", "-exportPort", "4402" };

		Map<String, String> m = ParameterHandle.strArryToMap(args);

		if (m.containsKey("-task")) {
			String string = m.get("-task");
			if (string.equals("sync_server")) {
				SyncServer.start(m);
			} else {
				SyncServerTask.start(m, string);
			}
		} else {
			System.out.println("no task,please set task by -task!");
			return;
		}
		System.out.println("task run success!");
	}
}
